<#include "/layout/header.ftl" />

<script>
$(function()
{
	/*$("#div_scroll").pullToRefresh(function()
	{
		$("#div_list").empty();
		$("#div_list").simpleLoad("/admin/info/login_log", {start: 1}, function(html)
		{
			$("#div_scroll").pullToRefreshDone();
			_start = 1;
			if ($.trim(html) == "NO_DATA")
			{
				console.log("下拉刷新加载完成：" + _start);
				$(document.body).destroyInfinite();
			}
			else
			{
				$(document.body).infinite().on("infinite", loadmore);
			}
		}, 1);
	});*/

	$(document.body).infinite().on("infinite", loadmore);

});

function loadmore()
{
	if (_loading)
		return;

	_loading = true;
	_start++;
	$.ajax(
	{
		url: "/admin/info/login_log",
		data: {start: _start},
		dataType: "html",
		type: "post",
		success: function(html)
		{
			_loading = false;
			if ($.trim(html) == "NO_DATA")
			{
				console.log("上拉加载完成：" + _start);
				$(document.body).destroyInfinite();
				$("#div_loadmore").remove();
			}
			else
			{
				$("#div_list").append(html);
			}
		},
		error: function()
		{
			_loading = false;
			$.toast("发生错误，请联系管理员", "text");
			$(document.body).destroyInfinite();
			$("#div_loadmore").remove();
		}
	});
}
var _loading = false;
var _start = 1;
</script>

<#--<div class="weui-pull-to-refresh__layer">
	<div class="weui-pull-to-refresh__arrow"></div>
	<div class="weui-pull-to-refresh__preloader"></div>
	<div class="down">下拉刷新</div>
	<div class="up">释放刷新</div>
	<div class="refresh">正在刷新</div>
</div>-->

<div class="weui-cells" id="div_list">
	<#include "/admin/info/login_log_grid.ftl" />
</div>

<div class="weui-loadmore" id="div_loadmore">
	<i class="weui-loading"></i>
	<span class="weui-loadmore__tips">正在加载</span>
</div>


<div class="return">
	<a href="${path}/admin/info/index"><li class="fa fa-arrow-left fa-2x ico_white"></li></a>
</div>

<#include "/layout/footer.ftl" />